{% extends "pretixpresale/base.html" %}
{% load i18n %}
{% load static %}
{% load thumb %}
{% load eventurl %}
{% load safelink %}
{% load compress %}
{% block thetitle %}
    {% block title %}{% endblock %}{% if url_name != "organizer.index" %} :: {% endif %}{{ organizer.name }}
{% endblock %}
{% block above %}
    {% compress js %}
        <script type="text/javascript" src="{% static "pretixpresale/js/ui/popover.js" %}"></script>
    {% endcompress %}
    {{ request.organizer.slug|json_script:"organizer_name" }}
    {% if organizer.settings.locales|length > 1 %}
        {% if organizer.settings.theme_color_background|upper != "#FFFFFF" or organizer.settings.organizer_logo_image_large %}
            <div class="container page-header-links">
                <div class="pull-right header-part flip header-content">
                    <div class="locales">
                        {% for l in languages %}
                            <a href="{% url "presale:locale.set" %}?locale={{ l.code }}&next={{ request.path }}%3F{{ request.META.QUERY_STRING|urlencode }}" class="{% if l.code == request.LANGUAGE_CODE %}active{% endif %}" rel="nofollow">
                                {{ l.name_local }}</a>
                        {% endfor %}
                    </div>
                </div>
            </div>
        {% endif %}
    {% endif %}
{% endblock %}
{% block page %}
    <div class="page-header {% if organizer_logo and organizer.settings.organizer_logo_image_large %}logo-large{% endif %}">
        <div class="{% if not organizer_logo or not organizer.settings.organizer_logo_image_large %}pull-left flip{% endif %}">
            {% if organizer_logo and organizer.settings.organizer_logo_image_large %}
                <a href="{% eventurl organizer "presale:organizer.index" %}" title="{{ organizer.name }}">
                    <img src="{{ organizer_logo|thumb:'1170x5000' }}" alt="{{ organizer.name }}"
                         class="organizer-logo" />
                </a>
            {% elif organizer_logo %}
                <a href="{% eventurl organizer "presale:organizer.index" %}" title="{{ organizer.name }}">
                    <img src="{{ organizer_logo|thumb:'5000x120' }}" alt="{{ organizer.name }}"
                            class="organizer-logo" />
                </a>
            {% else %}
                <h1><a href="{% eventurl organizer "presale:organizer.index" %}">{{ organizer.name }}</a></h1>
            {% endif %}
        </div>
        {% if organizer.settings.locales|length > 1 %}
            {% if organizer.settings.theme_color_background|upper == "#FFFFFF" and not organizer.settings.organizer_logo_image_large %}
                <div class="{% if not organizer_logo or not organizer.settings.organizer_logo_image_large %}pull-right flip{% endif %} loginbox">
                    <div class="locales">
                        {% for l in languages %}
                            <a href="{% url "presale:locale.set" %}?locale={{ l.code }}&next={{ request.path }}%3F{{ request.META.QUERY_STRING|urlencode }}" class="{% if l.code == request.LANGUAGE_CODE %}active{% endif %}" rel="nofollow">
                                {{ l.name_local }}</a>
                        {% endfor %}
                    </div>
                </div>
            {% endif %}
        {% endif %}
        <div class="clearfix"></div>
    </div>
    {% if messages %}
        {% for message in messages %}
            <div class="alert {{ message.tags }}">
                {{ message }}
            </div>
        {% endfor %}
    {% endif %}
    {% block content %}
    {% endblock %}
{% endblock %}
{% block footernav %}
    {% if not request.event and request.organizer.settings.contact_mail %}
        <a href="mailto:{{ request.organizer.settings.contact_mail }}">{% trans "Contact event organizer" %}</a> &middot;
    {% endif %}
    {% if not request.event and request.organizer.settings.imprint_url %}
        <a href="{% safelink request.organizer.settings.imprint_url %}" target="_blank" rel="noopener">{% trans "Imprint" %}</a>
        &middot;
    {% endif %}
{% endblock %}
